﻿#ifndef _USE_OPENSSL_H_
#define _USE_OPENSSL_H_

enum {
	e_aestype_ecb = 0,
	e_aestype_cbc,
	e_aestype_ctr,
	e_aestype_ofb,
	e_aestype_cfb,
};


bool Base64EncoderbyOpenssl(char* inStr,int inLen,char** outStr,int &outLen); //outStr new in Base64Encoder,need free by Base64EncoderFree
void Base64EncoderFreebyOpenssl(char* str);
bool Base64DecoderbyOpenssl(char* inStr,int inLen,char* outStr,int &outLen);
bool GenerateNonceStringbyOpenssl(char* noncestr, int noncelen); //noncestr.len > noncelen
bool SHA1ByOpenssl(char* instr, int inlen);
bool HMACSHAByOpenssl(const char * algo,  
					  const char * key, unsigned int key_length,  
					  const char * input, unsigned int input_length,  
					  unsigned char * output, unsigned int &output_length);
bool AES_EncryptDecryptByOpenssl(int type,const char *key, const char *iv, char * strPlainText, int textLen ,char *outText, int & outlen,int bEncrypt);

#endif //_USE_OPENSSL_H_
